<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<link rel="STYLESHEET" type="text/css" href="${base}/res/admin/css/tab.css"/>
	<script type="text/javascript" src="${base}/res/comm/js/jquery/jquery.js"></script>
	<script type="text/javascript" src="${base}/res/admin/js/admin.js"></script>
	<script language="javascript" type="text/javascript" src="${base}/res/comm/js/date/WdatePicker.js"></script>
	<script lang="javascript">
		function save(){
			var recommend = 0;
			if(document.getElementById('recommend').checked){
				recommend = $('#recommend').val();
			}
			ajaxPost('${base}/admin/auction/save.jhtml',{
				'id':$('#id').val(),
				'gid':$('#gid').val(),
				'type':$('input:radio[name="type"]:checked').val(),
				'sn':$('#sn').val(),
				'goodsname':$('#goodsname').val(),
				'costprice':$('#costprice').val(),
				'goodsprice':$('#goodsprice').val(),
				'starttime':$('#starttime').val(),
				'endtime':$('#endtime').val(),
				'startprice':$('#startprice').val(),
				'addprice':$('#addprice').val(),
				'addsecond':$('#addsecond').val(),
				'usebeat':$('#usebeat').val(),
				'pointc':$('#pointc').val(),
				'recommend':recommend,
				'goods_pic':$('input:radio[name="goods_pic"]:checked').val()
				},null,'json',savecallback);
		}
		function savecallback(data){
			window.alert(data.message);
			if(data.status=='success'){
				window.location.href='${base}/admin/auction/index.jhtml';	
			}
		}
	</script>
  </head>
  
<body style="overflow:auto;">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
	  <tr>
	    <td height="30">
	    <table width="100%" border="0" cellspacing="0" cellpadding="0">
	      <tr>
	        <td width="15" height="30"><img src="${base}/res/admin/images/tab_03.gif" width="15" height="30" /></td>
	        <td background="${base}/res/admin/images/tab_05.gif"><img src="${base}/res/admin/images/311.gif" width="16" height="16" /> <span class="STYLE4" style="16">添加/编辑商品分类</span></td>
	        <td width="14"><img src="${base}/res/admin/images/tab_07.gif" width="14" height="30" /></td>
	      </tr>
	    </table>
	    </td>
	  </tr>
	  <tr>
	    <td>
	    <table width="100%" border="0" cellspacing="0" cellpadding="0">
	      <tr>
	        <td width="9" background="${base}/res/admin/images/tab_12.gif">&nbsp;</td>
	        <td bgcolor="#e5f1d6">
	        <table width="100%">
	    		<tr>
	    			<td widith="50%">
	        <input type="hidden" id="id" name="id" value="${(auction.id)!"0"}">
	        <table width="99%" border="0" align="center" cellpadding="4" cellspacing="0" bgcolor="#CECECE">
    		<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">商品ID:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input id="gid" name="gid" value="<#if id==0>${goods.id}<#else>${auction.gid}</#if>" style="width:300px;" readOnly/></td>
		  		<td width="10%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">竞拍类型:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input type="radio" name="type" value="0" <#if ((auction.type)!0)?int==0>checked</#if>/>普通<input type="radio" name="type" value="1" <#if ((auction.type)!0)?int==1>checked</#if>/>新人</td>
		  		<td width="10%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">编号:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input id="sn" name="sn" value="${(auction.sn)!""}" style="width:300px;"/></td>
		  		<td width="10%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">商品名称:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input id="goodsname" name="goodsname" value="<#if id==0>${goods.goodsname}<#else>${auction.goodsname}</#if>" style="width:300px;"/></td>
		  		<td width="10%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">原价:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input id="costprice" name="costprice" value="${(auction.costprice)!"0"}" style="width:300px;"/></td>
		  		<td width="10%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">保价:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input id="goodsprice" name="goodsprice" value="${(auction.goodsprice)!"0"}" style="width:300px;"/></td>
		  		<td width="10%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">开始时间:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input class="Wdate" type="text" id="starttime" name="starttime" value="${(auction.starttime)!""}" onFocus="WdatePicker({isShowClear:true,skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true,maxDate:'#F{$dp.$D(\'endtime\')}'})" style="width:300px;"/></td>
		  		<td width="10%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">结束时间:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input class="Wdate" type="text" id="endtime"  name="endtime" value="${(auction.endtime)!""}" onFocus="WdatePicker({isShowClear:true,skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true,minDate:'#F{$dp.$D(\'starttime\')}'})" style="width:300px;"/></td>
		  		<td width="10%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">起始价格:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input id="startprice" name="startprice" value="${(auction.startprice)!"0"}" style="width:300px;"/></td>
		  		<td width="10%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">价格浮动:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input id="addprice" name="addprice" value="${(auction.addprice)!"0"}" style="width:300px;"/></td>
		  		<td width="10%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">时间浮动:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input id="addsecond" name="addsecond" value="${(auction.addsecond)!"0"}" style="width:300px;"/></td>
		  		<td width="10%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">消耗点数:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input id="usebeat" name="usebeat" value="${(auction.usebeat)!"0"}" style="width:300px;"/></td>
		  		<td width="10%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">奖励积分:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input id="pointc" name="pointc" value="${(auction.pointc)!"0"}" style="width:300px;"/></td>
		  		<td width="10%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">推荐:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input id="recommend" name="recommend" type="checkbox" value="1" <#if ((auction.recommend)!0)?int == 1>checked="checked"</#if>/></td>
		  		<td width="10%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">列表显示图片:</span></td>
		   		<td height="18" bgcolor="#FFFFFF">
		  		<#list accessoryList! as list>
		   		<div style="width: 100px; float: left; text-align: center;">
					<img src="${saveImagUrl+list.thumbnail}" width='72' height='72' style="margin: 5px; vertical-align: middle; opacity: 1;">
					<br><input type="radio" name="goods_pic" <#if ((auction.goods_pic)!0)?int==list.id?int>checked</#if> value="${list.id}"/>
				</div>	
		   		</#list>
		   		</td>
		  		<td width="10%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF" colspan=2 align="center">
		   			<input type="button" value="保存"  onclick="save()"/>&nbsp;&nbsp;
		   			<input type="button" value="返回" onclick="window.history.back(-1)">
		   		</td>
		   		<td width="10%"  bgcolor="#FFFFFF">&nbsp;</td>
		   	</tr>
		 	</table>
		 	</form>
		 	<td widith="50%" valign="top">
	    			<div align="right" width="95%">
				</div>
				<div id="gridTreeDiv">
				</div>
	    			</td>
	    		</tr>
	    	</table>
        </td>
        <td width="9" background="${base}/res/admin/images/tab_16.gif">	
        </td>
      </tr>
    </table>
	</td>
  	</tr>
  	<tr>
    	<td height="29">
    	<table width="100%" border="0" cellspacing="0" cellpadding="0">
      	<tr>
        <td width="15" height="29"><img src="${base}/res/admin/images/tab_20.gif" width="15" height="29" /></td>
        <td background="${base}/res/admin/images/tab_21.gif">&nbsp;</td>
        <td width="14"><img src="${base}/res/admin/images/tab_22.gif" width="14" height="29" /></td>
      	</tr>
    	</table></td>
  	</tr>
</table>
</body>
</html>
